import { h } from 'vue';
import { NTag } from 'naive-ui';
import { BasicColumn } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '序号',
    key: 'id',
    align: "center",
  },{
    title: '单价',
    key: 'danjia',
    align: "center",
  }, {
    title: '属性',
    key: 'attr',
    align: "center",
    render(row) {
      if (row.attr == 1) {
        return h(
          NTag,
          {
            type: 'error',
          },
          {
            default: () => ('普通宝'),
          },
        );
      } else if (row.attr == 2) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('快充宝'),
          },
        );
      }
    }
  }, {
    title: '免费策略',
    key: 'mianfei',
    align: "center",
  }, {
    title: '封顶时长',
    key: 'maxshichang',
    align: "center",
  }, {
    title: '封顶金额',
    key: 'maxmoney',
    align: "center",
  }, {
    title: '创建时间',
    key: 'create_time',
    align: "center",
  }, {
    title: '创建人',
    key: 'username',
    align: "center",
  }
];
